function compdni(){
	var letrasposibles = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E', 'T'];
	var dni1=document.form.dni.value;
	var letra2=dni1[11];
	var j=0;
dni1=dni1.replace('.','');
dni1=dni1.replace('.','');
dni1=parseInt(dni1);	
	var letra=letrasposibles[dni1 % 23];
  if(letra!= letra2) {
    alert("The letter or number provided is incorrect");
  }
}

function compara() { 
compdni();
	var password1=document.form.pass1.value;
	var password2=document.form.pass2.value;
if (password1 != password2) {
	alert("The passwords don't match.");
return false; } 
else {
return true;
}
}
